package com.wutoon.etl.constant;

import java.math.BigDecimal;

/**
 * @Author: 11162744
 * @Description: 通用常量类
 * @Date-Time: 2022/8/16 17:24
 */
public class CommonConstant {

    /**
     * 冒号分隔符
     */
    public static final String FLAG_COLON = ":";

    /**
     * yes
     * 2022/8/16 17:26
     */
    public static final String YES = "Y";

    /**
     * no
     * 2022/8/16 17:26
     */
    public static final String NO = "N";

    /**
     * 根据token获取对应一代
     */
    public static final String TOKEN_KEY = "openapi_token";

    /**
     * 入库单并发锁
     */
    public static final String INBOUND_KEY_PREFIX = "interface_center_inbound:";

    /**
     * 出库单并发锁
     */
    public static final String OUTBOUND_KEY_PREFIX = "interface_center_outbound:";

    /**
     * 履约中心，出入库并发锁
     */
    public static final String DELIVERY_RESULT = "delivery_result:";

    /**
     * 尝试加锁等待时间5秒
     */
    public static final int LOCK_WAIT_TIME = 5;

    /**
     * BigDecimal默认值
     */
    public static final BigDecimal BIG_DECIMAL_DEFAULT = new BigDecimal(0);

    /**
     * Integer默认值
     */
    public static final Integer INTEGER_DEFAULT = 1;

    /**
     * 出库tag
     */
    public static final String OUTBOUND_TAG = "outbound";

    /**
     * 人库tag
     */
    public static final String INBOUND_TAG = "inbound";

    /**
     * 导出超时时间，默认300s
     */
    public static final long TASK_EXPIRE_TIME = 300000L;

    public static final String AREA = "Area";
    public static final String TOWN_AND_VILLAGE = "Town & Village";
    public static final String SUB_DISTRICT = "Sub District";
    public static final String DISTRICT = "District";
    public static final String DISTRICT_GROUP = "district Group";
    public static final String STATE = "State";
    public static final String SALES_AREA = "Sales Area";
    public static final String MARKET = "Market";
    public static final String SUCCESS = "success";
    public static final String COMMA = ",";

    public static final String BREAK_LINK = "~";
    public static final String SLASH = "/";
    public static final String PHONE = "1";
    public static final String IOT = "2";
    public static final String STORE_LIMIT_PRE = "BH";


    public static final String MQ_DEAL_SUCCESS = "Y";

    public static final String SOURCE_FROM = "VK";
    public static final String SYSTEM = "vkcfs";
    public static final String TERMINAL_TYPE = "PC";
    public static final String LANGUAGE = "zh-CN";

    /**
     * 下划线分隔符
     */
    public static final String UNDER_SCORE = "_";

    /**
     * SalesHierarchy1
     */
    public static final String SALES_HIERARCHY1 = "201910110000001";

    public static final Integer IS_ENABLE_ACCOUNT = 1;
    public static final String FACTORY_CODE = "AGCHN000001";
    public static final String FACTORY_DESC = "工厂";

    public static final Long FACTORY_ID = 10001L;


    public static final String BAD = "2";
    public static final String GOOD = "1";
    public static final String INBOUND_COMPLETE = "已完成";

    public static final String ONE = "1";

    public static final String TWO = "2";

    public static final String ZERO = "0";

    public static final Integer THREE = 3;

    public static final String EMPTY = "";

    public static final String ENABLE = "1";

    public static final String DISABLE = "0";
    public static final Byte NEW_RETAIL_FLAG = 6;
    /**
     * 新零售不同步用友开关打开
     */
    public static final String OPEN = "1";
    public static final Integer IMEI_ACTIVE = 1;

    /**
     * 零售系统
     */
    public static final String SYSTEM_RETAIL = "retail";

    /**
     * 从数据库查询数据批次大小
     */
    public static final Integer FETCH_DATA_SIZE = 500;

    // 查询库存批量大小
    public static final Integer QUERY_INVENTORY_SIZE = 100;

    // 最大fetch大小
    public static final Integer MAX_FETCH_SIZE = 20000;

    // http采集最大分页大小
    public static final Integer HTTP_MAX_PAGE_SIZE = 2000;

    // 最大并发大小
    public static final Integer MAX_CONCURRENCY_SIZE = 8;

    // 最大并发大小
    public static final Integer DEFAULT_PUSH_CONCURRENCY_SIZE = 1;

    // 最大批处理大小
    public static final Integer MAX_BATCH_SIZE = 2000;

    // 数字0
    public static final Integer NUMBER_ZERO = 0;

    // 数字1
    public static final Integer NUMBER_ONE = 1;

    // 数据库连接超时
    public static final Integer TIMEOUT_SECONDS = 30;

    // 从队列获取数据超时时间
    public static final Integer POLL_TIMEOUT_SECONDS = 10;

    // 生产者推送超时时间
    public static final Integer PRODUCER_TIMEOUT_SECONDS = 60;

    // insert
    public static final String START_WITH_INSERT = "insert";

    // insert
    public static final String START_WITH_UPSERT = "upsert";

    // insert
    public static final String START_WITH_REPLACE_INTO = "replace into";

    // truncate table
    public static final String PRESQL_TRUNCATE = "truncate table ";

    // rename table
    public static final String RENAME_TABLE = "RENAME TABLE %s TO %s";

    // create table like
    public static final String CREATE_TABLE_LIKE = "CREATE TABLE %s LIKE %s";

    // create table like
    public static final String MYSQL_DRIVER = "com.mysql.cj.jdbc.Driver";

    // truncate table
    public static final Integer CONSUMER_TIME_OUT = 3600;

    // truncate table
    public static final Integer LOOP_OBSERVATION_TIME_OUT = 5;

    // truncate table
    public static final Integer SQL_QUERY_TIME_OUT = 1800;

    public static final String ORDER = "ORDER";

    public static final String FIRST_AGENT_CODE = "firstAgentCode";

    public static final String REF_METHOD = "ref:";

    public static final String BIZ_OPERATE_RECORD_ID = "biz_operate_record_id";

    public static final String NO_PAGETOTAL = "Integer.MAX_VALUE";

    public static final Integer SECOND_POOL_CORE_SIZE = 8;

    public static final String COLLECT_HTTP_MODE = "http";

    public static final String COLLECT_DUBBO_MODE = "dubbo";

    public static final String QUERY_SIMILAR_TABLE = "SHOW TABLES LIKE '%s%d%%'";

    public static final String DROP_HIS_TABLE = "drop table %s";
    public static final CharSequence POSITION_ROOT = "root";
}
